﻿using Framework.SqlSugarCore.Abstractions;
using Framework.SqlSugarCore.Repositories;
using my.abp.Domain.Shared.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using my.abp.Domain.Repositories.User;

namespace my.abp.SqlSugarCore.Repositories.User
{
	public class SysUserRepository : SqlSugarRepository<SysUser>, ISysUserRepository, ITransientDependency
	{
		public SysUserRepository(ISugarDbContextProvider<ISqlSugarDbContext> sugarDbContextProvider) : base(sugarDbContextProvider)
		{
		}

		public async Task<SysUser> GetAsync(string Account)
		{
			var user = await _DbQueryable.Includes(t => t.SysOrg).Filter(null, true).FirstAsync(u => u.Account.Equals(Account));
			_ = user ?? null;
			return user;
		}
	}
}
